package com.sikaryofficial.workbench.api;

import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.system.api.model.goods.GoodsTasteResp;
import com.sikaryofficial.workbench.manager.GoodsManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods/manage/api")
@Slf4j
public class GoodsManagerApi {

    @Autowired
    private GoodsManager goodsManager;

    /**
     * 查询口味数据
     * @param brandNo   品牌
     * @param keyWord   关键字（产品编码）
     * @param size
     * @return
     */
    @GetMapping("/listGoodsTaste")
    public R<List<GoodsTasteResp>> listGoodsTaste(@RequestParam(name = "brandNo") String brandNo,
                                                  @RequestParam(name = "keyWord") String keyWord,
                                                  @RequestParam(name = "size", defaultValue = "10") Integer size) {
        return R.ok(goodsManager.listGoodsTaste(brandNo, keyWord, size));
    }
}
